﻿@model CMSApplication.Areas.Administration.Models.CatalogGalleryModel 
@{
    ViewBag.Title = "Add Gallery";
}
<script type="text/javascript">

    function completedAjaxRequesRolesManager(obj) {

        var returnObj = eval('(' + obj.responseText + ')');

        if (returnObj.Status == "success") {
            if (returnObj.Message != null) {
                makeSuccessHighlightRolesManager(returnObj.Message);
            }
            else if (returnObj.RedirectUrl != null) {
                window.location.href = returnObj.RedirectUrl;
            }
        } else {
            makeErrorHighlightRolesManager(returnObj.Message);
        }

        return false;
    }

    function makeErrorHighlightRolesManager(messageStr) {
        var $highlight = $("<div style='padding: 0.7em; margin-bottom:5px; width: inherit;'><p><span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em;'></span><strong>Alert: </strong>" + messageStr + "</p></div>");
        $highlight.addClass("ui-state-highlight ui-corner-all");
        $highlight.prependTo(".warning-area");
        $highlight.delay(4000).fadeOut(500);
    }

    function makeSuccessHighlightRolesManager(messageStr) {
        var $highlight = $("<div style='padding: 0.7em; margin-bottom:5px; width: inherit;'><p><span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span><strong>Success: </strong>" + messageStr + "</p></div>");
        $highlight.addClass("ui-state-highlight ui-corner-all");
        $highlight.prependTo(".warning-area");
        $highlight.delay(4000).fadeOut(500);
    }
</script>
<div class="row-fluid">
    <div class="span12">
        <div class="head">
            <div class="isw-documents">
            </div>
            <h1>
                Add new gallery</h1>
            <div class="clear">
            </div>
        </div>
        <div class="block-fluid">
            @using (Html.BeginForm("AddOrUpdateCatalogGallery", "GalleryManager", FormMethod.Post, new { enctype = "multipart/form-data", @id = "validation" }))
            {
                <div class="warning-area">
                </div>

                @Html.HiddenFor(model => model.CatalogID)
                @Html.HiddenFor(model => model.Image, new { id = "modelImages" })
                <div class="row-form">
                    <div class="span2">
                        Gallery Name:</div>
                    <div class="span9">
                        @Html.TextBoxFor(x => x.Name, new { @class = "span8 validate[required]" })</div>
                    <div class="clear">
                    </div>
                </div>
                        
                <div class="row-form">
                    <div class="span2">
                        Thumbnail :</div>
                    <div class="span5" id="upload_list">
                        <input type="file" multiple name="FileUp" />
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">
                        Description</div>
                    <div class="span9">
                        @Html.TextAreaFor(x => x.Description, new { @cols = "10", @class = "ckeditorId", @rows = "30", @id = "ckeditorId" })</div>
                    <div class="clear">
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">
                        Meta title:</div>
                    <div class="span9">
                        @Html.TextBoxFor(x => x.MetaTitle)</div>
                    <div class="clear">
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">
                        Meta keywords:</div>
                    <div class="span9">
                        @Html.TextBoxFor(x => x.MetaKeywords)</div>
                    <div class="clear">
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">
                        Meta description:</div>
                    <div class="span9">
                        @Html.TextAreaFor(x => x.MetaDescription)</div>
                    <div class="clear">
                    </div>
                </div>
                <br />
                <div class="row-form">
                    <div class="span4">
                        <input type="submit" class="btn btn-info span3" value="Submit" />
                    </div>
                    <div class="span8">
                        <span style="color: red">@ViewBag.Message</span>
                    </div>
                    <div class="clear">
                    </div>
                </div>
            }
        </div>
    </div>
</div>
